home *** CD-ROM | disk | FTP | other *** search
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <title>Curriculum dello studente scelto</title>
- </head>
- <body>
- <h3>Scegli lo studente di cui vuoi vedere la situazione</h3><p>
- <?php
- $nome_db = "universitas";
- $id_connessione=@mysql_connect("127.0.0.1","root","pluto") or die("Non Φ possibile accedere al server");
- @mysql_select_db($nome_db,$id_connessione) or die("Non Φ stato possibile accedere al database");
-
- // scrivo la query che mi serve concatenando dei campi
- $q="SELECT CONCAT(matricola,' - ',cognome,' ',nome) AS stud, matricola FROM studente ORDER BY cognome, nome, matricola";
- $id_ris=@mysql_query($q) or die("Non Φ possibile eseguire la query");
-
- // creo il form con la casella a discesa da cui scegliere il nome dello studente. La scelta sarα inviata alla pagina stud_cv.php
- ?>
- <form name="scelta" method="post" action="stud_cv.php">
- <select name="stud_nome">
- <?php
- while ($record=mysql_fetch_array($id_ris)) {
- echo "<option value=".$record[matricola].">".$record[0]."</option>";
- }
- mysql_close();
- ?>
- </select><p>
- <input type="submit" name="invia" value="Vai alla scheda" />
- </form>
- </body>
- </html>